-
Notifications
You must be signed in to change notification settings - Fork 68
implement support for forgejo commit statuses #902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
My apologies, I forgot to add the license so i will amend and push |
|
Build failed. ❌ pre-commit FAILURE in 2m 49s |
1775434 to
39141ae
Compare
|
Build failed. ❌ pre-commit FAILURE in 2m 50s |
9d6dd3c to
39141ae
Compare
|
Build failed. ❌ pre-commit FAILURE in 2m 57s |
Signed-off-by: Olamidepeterojo <[email protected]>
5aa960c to
271bba4
Compare
|
Build failed. ❌ pre-commit FAILURE in 2m 51s |
bb8092f to
133f6c5
Compare
|
Build failed. ✔️ pre-commit SUCCESS in 2m 52s |
ogr/services/forgejo/commit_flag.py
Outdated
| from datetime import datetime | ||
| from typing import Any | ||
|
|
||
| import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using pyforgejo SDK
ogr/services/forgejo/commit_flag.py
Outdated
| self.comment = raw.get("comment") | ||
| self.uid = raw.get("id") | ||
| self.url = raw.get("url") | ||
| # Parse timestamps in ISO8601 format (adjust format if needed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI generated?
ogr/services/forgejo/commit_flag.py
Outdated
| self._created = datetime.strptime(raw.get("created"), "%Y-%m-%dT%H:%M:%SZ") | ||
| self._edited = datetime.strptime(raw.get("updated"), "%Y-%m-%dT%H:%M:%SZ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using pyforgejo this can be avoided entirely… it's doing all the parsing by default
ogr/services/forgejo/commit_flag.py
Outdated
| f"{project.forge_api_url}/repos/{project.owner}/{project.repo}/commits/" | ||
| f"{commit}/statuses" | ||
| ) | ||
| headers = project.get_auth_header() # Get auth headers from project config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made up method, doesn't exist… there's no reason for it to exist, it is handled by pyforgejo…
| def project(service): | ||
| return service.get_project( | ||
| repo="ogr", | ||
| namespace="packit-service", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't exist…
| return {"Authorization": "Bearer dummy_token"} | ||
|
|
||
|
|
||
| @responses.activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have this dependency, we're using requre
can also notice the red CI because of that
Signed-off-by: Olamidepeterojo <[email protected]>
133f6c5 to
4a1e96e
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 37s |
|
Hi @olamidepeterojo ! Thank you for all the contributions. I have a few generic suggestions so your contributions can be accepted more easily.
Let us know if you need any guidance. |
|
Thank you @lachmanfrantisek. I have taken notes of your suggestions. |
|
Hello @mfocko , could you kindly review for incase there are changes to be made? |
TODO:
packit/packit.dev.Fixes #882
Related to #866
Merge before/after
RELEASE NOTES BEGIN
Packit now supports automatic ordering of ☕ after all checks pass.
RELEASE NOTES END